/* lambert.h */

#ifndef DODO_LAMBERT_H
#define DODO_LAMBERT_H

#include <cmath>

#include <dodo_plot/kernel/point.h>
#include <dodo_plot/kernel/basic_utils.h>
#include <dodo_plot/map/projection_common.h>

namespace dodo_plot
{

class Lambert : public Projection_Base
{
public:
	Point operator() (double lon, double lat) const;
	Point operator() (const Point& lonlat) const;

public:
	Lambert(double standard_parallel_1, 
		double standard_parallel_2,
		double ref_lon,
		double ref_lat,
		const Point& corner_1,
		const Point& corner_2
	       );

private:
	double std_par_1_, std_par_2_;
	double ref_lon_, ref_lat_;

private:
	// helper that make it fast
	// names are according to the wiki page:
	// http://en.wikipedia.org/wiki/Lambert_conformal_conic_projection
	void init();
	Point map_proj_only(double lon, double lat) const;
	double n_;
	double rho_0_;
	double f_;
	Pos_Projection pos_proj_;
};

}

#endif //DODO_LAMBERT_H

